package com.sugar.service.system.privilege;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sugar.base.query.PageModel;
import com.sugar.domain.system.privilege.PrivilegeResourceModel;
import com.sugar.persistence.system.privilege.IPrivilegeResourceModel;

@Service
public class PrivilegeResourceModelServiceBean implements IPrivilegeResourceModelService{

	@Resource
	private IPrivilegeResourceModel prmdao ;

	@Override
	public void deletePRModelService(int id) {
		this.prmdao.deletePRModelDao(this.loadPRModelByIdService(id)) ;
	}

	@Override
	public void deleteSelectPRModelService(Object[] ids) {
		this.prmdao.deleteSelectPRModelDao(ids) ;
	}

	@Override
	public List<PrivilegeResourceModel> findPRModelService(Object[] param) {
		String queryString = "select o from PrivilegeResourceModel o" ;
		
		return this.prmdao.findPRModelDao(queryString, null, param, null) ;
	}

	@Override
	public PageModel<PrivilegeResourceModel> getScorllPRModelService(
			Object[] param, int firstPage, int pageSize) {
		String queryString = "select o from PrivilegeResourceModel" ;
		return this.prmdao.getScorllPRModelDao(queryString, null, param, firstPage, pageSize, null);
	}

	@Override
	public PrivilegeResourceModel loadPRModelByIdService(int id) {
		return this.prmdao.loadPRModelByIdDao(id) ;
	}

	@Override
	public void savePRModelService(PrivilegeResourceModel prm) {
		this.prmdao.savePRModelDao(prm) ;
	}

	@Override
	public void updatePRModelService(PrivilegeResourceModel prm) {
		this.prmdao.updatePRModelDao(prm) ;
	}
	

}
